<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>

    let obj = {
      age: 18,
      name: 'tom',
      other: {
        like: 'music'
      }
    }
    console.log('obj?.age:', obj?.age)
    console.log('obj?.a:', obj?.a)
    console.log('obj?.other?.a:', obj?.other?.a)
  </script>
</body>

</html>